//
//  AddBalanceAndExtractListVC.m
//  OnionHome
//
//  Created by fengjie on 2019/9/14.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import "AddBalanceAndExtractListVC.h"
#import "MyWalletDetailListCell.h"

@interface AddBalanceAndExtractListVC ()
/**listViewTool*/
@property (nonatomic,strong)UITableViewTool*listViewTool;
/**数据源*/
@property (nonatomic,strong)NSMutableArray*dataSoure;

@end

@implementation AddBalanceAndExtractListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.listViewTool.listView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

-(void)setType:(AddBalanceType)type{
    _type = type;
    if (type == AddBalance) {
        self.title = @"充值记录";
    }else{
        self.title = @"提现记录";
    }
}
-(UITableViewTool*)listViewTool{
    if(!_listViewTool){
        _listViewTool=[[UITableViewTool alloc] initWithFrame:CGRectZero style:UITableViewStylePlain registerCellClassName:NSStringFromClass([MyWalletDetailListCell class]) identifier:NSStringFromClass([MyWalletDetailListCell class]) dataArray:self.dataSoure delegate:self dataSourceBlock:^(id  _Nonnull TempCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull TempData) {
            MyWalletDetailListCell * cell = (MyWalletDetailListCell *)TempCell;
            cell.balanceDic = TempData;
            
        } selectCell:^(id  _Nonnull TempCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull TempData) {
            
        }];
        [_listViewTool.listView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
        [_listViewTool.listView setSeparatorColor:UIColorFromRGB(0xE7EEE7)];
    }
    return _listViewTool;
}
-(NSMutableArray *)dataSoure{
    if (!_dataSoure) {
        NSArray * extrArray = @[@{@"leftTopName":@"提现中",@"leftBomName":@"2018-01-01 12:30:00",@"rightName":@"￥400"},@{@"leftTopName":@"提现完成",@"leftBomName":@"2018-01-01 12:30:00",@"rightName":@"￥400"},@{@"leftTopName":@"提现完成",@"leftBomName":@"2018-01-01 12:30:00",@"rightName":@"￥400"},@{@"leftTopName":@"提现完成",@"leftBomName":@"2018-01-01 12:30:00",@"rightName":@"￥400"},@{@"leftTopName":@"提现完成",@"leftBomName":@"2018-01-01 12:30:00",@"rightName":@"￥400"}];
        
        NSArray * addArray =  @[@{@"leftTopName":@"订单号 123423454335",@"leftBomName":@"2018-01-01 12:30:00  支付宝充值￥50",@"rightName":@"待完成"},@{@"leftTopName":@"订单号 123423454335",@"leftBomName":@"2018-01-01 12:30:00  支付宝充值￥50",@"rightName":@"已完成"},@{@"leftTopName":@"订单号 123423454335",@"leftBomName":@"2018-01-01 12:30:00  支付宝充值￥50",@"rightName":@"已完成"},@{@"leftTopName":@"订单号 123423454335",@"leftBomName":@"2018-01-01 12:30:00  支付宝充值￥50",@"rightName":@"已完成"},@{@"leftTopName":@"订单号 123423454335",@"leftBomName":@"2018-01-01 12:30:00  支付宝充值￥50",@"rightName":@"已完成"}];
        _dataSoure =[NSMutableArray array];
        
        if (self.type == AddBalance) {
            [_dataSoure addObjectsFromArray:addArray];
        }else{
            [_dataSoure addObjectsFromArray:extrArray];
        }
    }
    return _dataSoure;
}

@end
